package com.tmt.im.jpa.entity;

import com.tmt.data.jpa.entity.TmtBaseEntityId;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;

import java.io.Serial;
import java.io.Serializable;

/**
 * 上传的文件信息表
 *
 * @Description TODO
 * @Author wuyi
 * @Date 2024/7/30 11:19
 * @Version 1.0
 **/
@Getter
@Setter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "uploaded_file")
@Tag(name = "UploadedFile", description = "上传的文件信息表")
public class UploadedFile extends TmtBaseEntityId implements Serializable {

    @Serial
    private static final long serialVersionUID = 8171470608459622430L;

    @Schema(description = "上传文件的原始名称")
    private String fileName;

    @Schema(description = "上传头像的类型：0为用户头像，1为群组头像, 2为普通文件（可能是音视频文件或图片文件）")
    private int type;

    @Schema(description = "文件的后缀名称")
    private String suffixType;

    @Schema(description = "下载时文件流的ContentType参数值")
    private String contentType;

    @Schema(description = "文件的URI")
    private String fileUri;

    @Schema(description = "文件的长度")
    private Long fileSize;

}